***********************************************************************************************
***
***	INTERTEMPORAL EVIDENCE ON THE STRATEGY OF POPULISM IN THE US (Gennaro, Lecce, Morelli)
***	Replication Package
***  
*** Appendix - Table A11
***
***********************************************************************************************



clear
est clear 

* Indicate location of the replication package here
cd "/Replication Package"


* Presidential

use "3_data/for_analysis/presidential_election_complete.dta", clear

egen mch_s = std(mch)
egen pop_dim2_s = std(pop_dim2)
drop if mch_s==.

eststo m1: reg pop_dim2_s trump  i.mcode, cl(MSANAME)
eststo m2: reg pop_dim2_s i.trump##c.mch_s  i.mcode, cl(MSANAME)
eststo m3: reg pop_dim2_s i.trump##c.mch_s##i.swing  i.mcode, cl(MSANAME)


* Congress

use "3_data/for_analysis/congress_election_both.dta", clear

keep if uncont==0 & indep==0
global controls "female i.age_cat_num i.ethnicity2 i.educ_cat i.election_year"

eststo m4: areg pop_dim2_s outsider_correct $controls , a(state) cluster(district)
eststo m5: areg pop_dim2_s i.outsider_correct##c.econ $controls , a(state) cluster(district)
eststo m6: areg pop_dim2_s i.outsider_correct##i.competitivedistricts##c.econ $controls , a(state) cluster(district)


* Save

esttab m1 m2 m3 m4 m5 m6 using "4_results/tables/tabA11.tex", f label replace booktabs alignment(D{.}{.}{-1}) ///
s(N r2, fmt(0 2) label("Observations" "R-squared")) ///
nomtitles star(* 0.10 ** 0.05 *** 0.01) r2 b(3) se(3) brac nonotes
